﻿@{
    Html.LOBHtmlHelper().SetLayout(this);
    Html.LOBHtmlHelper().SetMoreFunction(this, "{ text: '<span id=\"mnu2D\">2D</span>', encoded: false}, { text: '<span id=\"mnu3D\">3D</span>', encoded: false},{ text: '<span id=\"mnuMold\">Khuôn sáp</span>', encoded: false}"); 
}
@{Html.RenderPartial("LinkPath");}

<div class="mtitle">
    @ViewBag.Title
</div>

@Html.LOBHtmlHelper().Busy("busyMain")

<table  cellpadding="1" cellspacing="1" style="table-layout:fixed;" width="100%">
    <tr>
        <td style="width: 100%;height:100%" valign="top">
            @Html.LOBHtmlHelper().GridViewCustomLoad("SONo", @ViewBag.SoNo, "", true, false, false, null, "LineOfBusiness", "LineOfBusiness.Helper.DataUtilities", "GetModels")
        </td>
    </tr>
</table>

<script type="text/javascript">

    var _codeBaseGrid = new CodeBaseGrid();
    $(document).ready(function () {
        _codeBaseGrid.Init(
            "grvItemModels",
            "ItemName",
            "",
            "",
            "",
            "",
            "",
            "SR",
            "ItemModels",
            ""
            );
    });


    function MoreFunctionClick(id) {
            var current = GetCurrentRow("grvItemModels");

            if (current != null) {
                {
                    if (id == 'mnu2D') {
                        ShowWindowCallback('@Url.Action("GetModel", "Models")?Mode=1&ItemID=' + current.ItemID, 500, 300, 'Mẫu 2D', function () { _codeBaseGrid.refreshData(current.ItemID); });
                    }
                    if (id == 'mnu3D') {
                        ShowWindowCallback('@Url.Action("GetModel", "Models")?Mode=2&ItemID=' + current.ItemID, 500, 300, 'Mẫu 3D', function () { _codeBaseGrid.refreshData(current.ItemID); });
                    }
                    if (id == 'mnuMold') {
                        ShowWindowCallback('@Url.Action("GetModel", "Models")?Mode=3&ItemID=' + current.ItemID, 500, 300, 'Mẫu Khuôn sáp', function () { _codeBaseGrid.refreshData(current.ItemID); });
                    }
                }
            }
        }
</script>
